<html lang="en">
<head>
    <title>私人订制管理</title>
    <#include "../common/header.ftl">
    <script>
        $(function () {

        });
    </script>
    <style>
        /*设置模态框中的图片铺满*/
        #showModal img{
            width: 100%;
        }
        /*当内容大于模态框时,会自定设置滚动条*/
        #showModal .modal-body{
            max-height: 600px;
            overflow-y: auto;
        }
    </style>
    <script>
        
        $(function () {
            $('.selectContent').click(function () {

                var json = $(this).data('json');
                $('#showModal input[name="id"]').val(json.id);
                $('#showModal select[name="state"]').val(json.state);
                $('#showModal').modal('show');
            })

            //提交
            $('.submit').click(function () {
              $('#saveForm').ajaxSubmit(function (data) {
                    if(data.success){
                        window.location.reload();
                    }else {
                        alert(data.msg);
                    }
              })
            })
        })
    </script>

</head>
<body>
<!--左侧菜单回显变量设置-->
<#assign currentMenu="custmoize">
<div class="container " style="margin-top: 20px">
    <#include "../common/top.ftl">
    <div class="row">
        <div class="col-sm-2">
            <#include "../common/menu.ftl">
        </div>
        <div class="col-sm-10">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line ss">私人订制管理</h1>
                </div>
            </div>
            <!--高级查询--->
            <form class="form-inline" id="searchForm" action="/customize/list.do" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
                <div class="form-group">
                    <label  class="col-sm-5 control-label">客户状态：</label>
                    <div class="col-sm-6">
                        <select class="form-control" id="state" name="state">
                            <option value="-1">全部</option>
                            <option value="10">潜在</option>
                            <option value="11">刚签约</option>
                            <option value="12">服务之后的客户</option>
                        </select>
                    </div>
                </div>
                <script>
                    $('#state').val(${qo.state!});
                </script>
                <button id="btn_query" class="btn btn-info"><span class="glyphicon glyphicon-search"></span> 查询</button>
            </form>

            <table class="table table-striped table-hover" >
                <thead>
                    <tr>
                        <th>编号</th>
                        <th>客户类型</th>
                        <th>成人数量</th>
                        <th>儿童数量</th>
                        <th>出发地</th>
                        <th>旅游地</th>
                        <th>开始时间</th>
                        <th>结束时间</th>
                        <th>预计花费</th>
                        <th>电话</th>
                        <th>备注</th>
                        <th>客户状态</th>
                        <th> 操1作</th>
                    </tr>
                </thead>
               <#list result.list as entity>
                   <tr>
                       <td>${entity_index + 1}</td>
                       <td>${entity.customTypeDisplay!}</td>
                       <td>${entity.passengerAdult!}</td>
                       <td>${entity.passengerChild!}</td>
                       <td>${(entity.srcplace.name)!}</td>
                       <td>${(entity.destplace.name)!}</td>
                       <td>${(entity.begintime?string("yyyy-MM-dd"))!}</td>
                       <td>${(entity.endtime?string("yyyy-MM-dd"))!}</td>
                       <td>${(entity.estimatedcost)!}</td>
                       <td>${(entity.tel)!}</td>
                       <td>${(entity.other)!}</td>
                       <td>${entity.stateDisplay!}</td>
                       <td>
                           <a href="javascript:void(0);" class="btn selectContent" data-json='${entity.jsonString!}' >修改状态</a>
                       </td>
                   </tr>
               </#list>
            </table>
            <#include "../common/page.ftl">
        </div>
    </div>
</div>

<div class="modal fade" id="showModal">
    <div class="modal-dialog">
        <form action="/customize/update.do" id="saveForm" method="post">
            <input type="hidden" name="id">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">修改状态</h4>
            </div>
            <div class="form-group">
                    <label  class="col-sm-6 control-label">当前客户状态：</label>
                    <select class="form-control" id="state" name="state">
                        <option value="-1">全部</option>
                        <option value="10">潜在</option>
                        <option value="11">刚签约</option>
                        <option value="12">服务之后的客户</option>
                    </select>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success submit" data-dismiss="modal" >提交</button>
            </div>
        </div>
        </form>
    </div>
</div>


</body>
</html>